Generation of Debugging Interfaces for Linux Kernel Services
نویسندگان
چکیده
The Linux kernel does not export a stable, well-de ned kernel interface, complicating the development of kernel-level services, such as device drivers and le systems. While there does exist a set of functions that are exported to external modules, these are continually changing, and have implicit, ill-documented preconditions, which, if not satis ed, can cause the entire system to crash or hang. However, no speci c debugging support is provided. In this paper, we present Diagnosys, an approach to automatically constructing a debugging interface for the Linux kernel. In our approach, a designated kernel maintainer uses Diagnosys to identify pre and post conditions on the use of the exported functions. The maintainer then publishes this information for download by service developers, who can use Diagnosys to generate a debugging interface specialized to their code. This interface is then included within a service implementation, such that when the service is tested it records information about potential problems. The recorded information is then made available to the service developer on reboot after a kernel crash or hang. We have tested our approach on several recent releases of the Linux kernel. We rst show that the debugging interfaces generated by our approach provide useful log information in the case of faults. We then show that safety holes are prevalent in the Linux kernel, and that many of the functions exported by the Linux kernel to kernel-level services have non-trivial implicit pre and post conditions that must be respected to ensure their safe execution. Finally, we show that our approach incurs only a slight performance penalty. Key-words: Linux kernel, automatic generation, static analysis, driver development ∗ LaBRI, University of Bordeaux † LiP6, INRIA/REGAL ha l-0 06 41 26 2, v er si on 1 15 N ov 2 01 1 Génération d'interfaces d'aide à la mise au point pour les services noyau de Linux Résumé : Le noyau de Linux ne dé nit pas une interface de programmation précise et stable, ce qui complique le dévelopment des services noyau tels que les pilotes de périphériques et les systèmes de chiers. Bien qu'il existe un ensemble de fonctions exportées pour utilisation par les modules du noyau, celles-ci sont continuellement modi ées et présentent des préconditions d'usages à la fois implicites et peu documentées, et qui, lorsqu'elles ne sont pas satisfaites, peuvent entrainer un crash ou un blocage de tout le système d'exploitation. Cependant, Linux n'o re aucun moyen spéci que de débogger de tels problèmes. Dans cet article, nous présentons Diagnosys, une approche pour construire automatiquement une interface d'aide à la mise au point des services noyau de Linux. Dans notre approche, un mainteneur du noyau utilise Diagnosys pour identi er des pré et post conditions sur l'utilisation des fonctions exportées. Le mainteneur met ensuite à disposition cette information qui sera téléchargée par des développeurs de services qui utilisent à leur tour Diagnosys pour générer une interface spécialisée à leur code. Cette interface est ainsi ajoutée au code de leur service de sorte que lors du test du service, elle enregistre des informations sur les problèmes potentiels. L'information enregistrée est ensuite disponible après rédémarrage du noyau. Nous avons testé notre approche sur plusieurs versions du noyau de Linux. Nous montrons d'abord que les interfaces générées par notre approche fournissent des informations de journalisation utiles en cas de fautes. Nous montrons ensuite que les portions de code représentant des lacunes de sécurité sont répandues dans le noyau de Linux, et que de nombreuses fonctions exportées pour les services noyau de Linux présentent des pré et post conditions implicites et non triviales qui doivent être respectées pour assurer une exécution sûre. Finalement, nous montrons que notre approche induit uniquement de faibles pertes de performation. Mots-clés : Le noyau linux, génération automatique, analyse statique ha l-0 06 41 26 2, v er si on 1 15 N ov 2 01 1 Generation of Debugging Interfaces for Linux Kernel Services 3
منابع مشابه
Debugging the Linux Madwifi Driver
This report describes a bug in the fragmentation code of the Madwifi driver for the Atheros chipset under the Linux kernel. The bug is due to incorrect locking of a data structure. Techniques for Linux kernel debugging are described, and a fix for the bug is presented.
متن کاملRump File Systems: Kernel Code Reborn
When kernel functionality is desired in userspace, the common approach is to reimplement it for userspace interfaces. We show that use of existing kernel file systems in userspace programs is possible without modifying the kernel file system code base. Two different operating modes are explored: 1) a transparent mode, in which the file system is mounted in the typical fashion by using the kerne...
متن کاملMARKOVIAN SOFTWARE RELIABILITY MODEL FOR TWO TYPES OF FAILURES WITH IMPERFECT DEBUGGING RATE AND GENERATION OF ERRORS
N
متن کاملRemote Debugging of Raspberry Pi with JTAG interface
This paper discusses the JTAG (Join Test Action Group) standard and its use to obtain debug information from circuits and chips. This standard describes a protocol that gives the access to a very low-level outputs from the chips where this technology is enabled. The main described scenario is using this protocol on a Raspberry Pi (RPi) board. In particular, it comes with an ARM (Acorn RISC Mach...
متن کاملBridging the Semantic Gap Through Static Code Analysis
The semantic gap is a challenge inherent in all applications of virtual machine introspection (VMI). It describes the disconnect between the low-level state that the hypervisor has access to and its semantics within the guest. A common approach to bridge this gap is to utilize the debugging symbols of an inspected operating system kernel, although it is well understood that this information doe...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2011